package com.demo.apparel.mapper.uniapp;

import com.demo.apparel.entity.FeedbackImg;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WxFeedbackImgMapper {

    /**
     *
     * @param feedbackImg
     * @return
     */
    @Insert("""
        INSERT INTO feedback_img (id, user_id, feedback_id, img_url, created_time)
        VALUES (#{id}, #{userId}, #{feedbackId}, #{imgUrl}, #{createdTime})
    """)
    int insert(FeedbackImg feedbackImg);

    @Update("UPDATE feedback_img SET feedback_id = #{feedbackId} WHERE id = #{id}")
    int updateFeedbackIdById(@Param("id") String id, @Param("feedbackId") String feedbackId);

    @Select("SELECT * FROM feedback_img WHERE feedback_id = #{feedbackId}")
    List<FeedbackImg> selectByFeedbackId(@Param("feedbackId") String feedbackId);


}